npm ERR! enoent ENOENT: no such file or directory, open ... package.json


問題

npm install 遇到 no such file or directory,原因是沒有 package.json。

錯誤訊息:

vagrant@homestead:~/code/redis-test$ npm install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/code/redis-test/node_modules/webpack-dev-server/node_modules/is-absolute-url/package.json.3672698083
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/redis-test/node_modules/webpack-dev-server/node_modules/is-absolute-url/package.json.3672698083'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2020-09-03T02_30_49_347Z-debug.log

解決

npm init -y 產生 package.json








你可能感興趣的文章

[Week2] 給自己看的 JavaScript 筆記 - 迴圈、函式、其他觀念

[Week2] 給自己看的 JavaScript 筆記 - 迴圈、函式、其他觀念

Ubuntu18.04 yolov3 tiny 轉 onnx 使用 Python 3.6.9

Ubuntu18.04 yolov3 tiny 轉 onnx 使用 Python 3.6.9

D29_第三週作業

D29_第三週作業






留言討論